The following steps describe how to view reports in HTML5 Viewer.
Paste inside the <head></head> tags |
Copy Code
|
---|---|
<link rel="stylesheet" href="css/GrapeCity.ActiveReports.Viewer.Html.css" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" type="text/javascript"></script> |
Paste inside the <head></head> tags |
Copy Code
|
---|---|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" /> |
Paste inside the <body></body> tags |
Copy Code
|
---|---|
<div id="viewer" style="width:800px;height:600px;"></div> |
Paste inside the licenses.licx file |
Copy Code
|
---|---|
|
Paste inside the <script></script> tags |
Copy Code
|
---|---|
$(function () { var viewer = GrapeCity.ActiveReports.Viewer( { element: '#viewer', report: { id: "PageReport.rdlx" }, reportService: { url: '/ActiveReports.ReportService.asmx' }, uiType: 'desktop' }); }); |
Cross-Origin Resource Sharing is a technology for the web that provides async web operations to directly access reports from different domains. CORS works by adding a special header to responses from a server to the client. If a response contains the Access-Control-Allow-Origin header, then you can directly access the reports from another domain. If you get error 404 or 500 on the report preview, please make sure that your browser supports CORS.
The following steps describe how to access reports from different domain using CORS.
Paste inside the Global.asax.cs |
Copy Code
|
---|---|
|
Paste inside the Global.asax.vb |
Copy Code
|
---|---|
|
$.support.cors = true;
code on the client side while initializing the HTML5 Viewer to access reports from a different domain.